public class test {
    public static void main(String[] args) {
        // StringBuilder示例
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append("StringBuilder: ");
        for (int i = 0; i < 5; i++) {
            stringBuilder.append("Hello ");
        }
        System.out.println(stringBuilder.toString());

        // StringBuffer示例
        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append("StringBuffer: ");
        for (int i = 0; i < 5; i++) {
            stringBuffer.append("Hello ");
        }
        System.out.println(stringBuffer.toString());
    }
}